﻿namespace HRIS.TimeTracker
{
    using OpenQA.Selenium;
    using Iit.Automation.Browsers;
    using Iit.Automation.Browsers.ConfigDataProvider;
    using Iit.Automation.Browsers.Shared;
    using HRIS.Browser.UI.Framework;
    using OpenQA.Selenium.Chrome;
    using System;
    using HRIS.Browser.UI.Framework.DesktopWebControls;
    using HRIS.Browser.Resources;
    using System.Threading;

    class Program
    {
        static void Main(string[] args)
        {
            foreach (Enums.RegisteredBrowsers browser in Enum.GetValues(typeof(Enums.RegisteredBrowsers)))
            {
                Thread t = new Thread(() =>
                {
                    HRISLogin(browser, Enums.PlatFormTypes.Desktop);
                });

                t.Start();
            }
        }

        public static void HRISLogin(Enums.RegisteredBrowsers browser, Enums.PlatFormTypes platform)
        {
            if (browser != Enums.RegisteredBrowsers.IE && browser != Enums.RegisteredBrowsers.Safari)
            {
                ResourceManager _chromeResources = ResourceManager.GetInstance(browser, platform);
                _chromeResources.Browser.Url = "http://hris.initto.com/adrenalin/";
                Login login = (Login)_chromeResources.Browser.ComponentFactory.GetComponent<ILogin>();
                login.DoLogin("int430", "Hilary@03");
            }
        }
    }
}
